<%@ page contentType="text/html; charset=utf-8" language="java" import="java.sql.*" errorPage="" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
	<jsp:include page="../common/top.jsp"></jsp:include>
	<!-- ================== PAGE LEVEL STYLE START ================== -->
	<link rel="stylesheet" href="resource/assets/data-table/css/data-table.css" />
	<!-- ================== PAGE LEVEL STYLE END ================== -->
	
    <jsp:include page="../common/left.jsp"></jsp:include>
  
    <div id="content">
    <div class="container-fluid">
			<h1 class="page-title">角色管理 <small>在这里进行角色管理</small></h1>
			<div class="row-fluid">
				<div class="span12">
					<div class="widget">
						<div class="widget-header">
							<h4>角色列表</h4><a class="btn btn-primary" href="RoleActiontoAddRole" id="prompt" data-original-title=""><i class="icon-plus"></i>添加角色</a>
						</div>
						<div class="widget-content">
							<table id="data-table" class="table table-striped table-bordered">
								<thead>
									 <tr>
                          <th style="width:5%">
                            
                          </th>
                          <th style="width:20%">
                           	 名称
                          </th>
                          <th style="width:20%" class="hidden-phone">
                                                                       描述
                          </th>
                          <th style="width:10%" class="hidden-phone">
                           	操作
                          </th>
                        </tr>
								</thead>
								<tbody>
									<!--迭代-->
                        <s:iterator value="pager.data" var="f" >
                        	<tr id="${f.id }">
                          <td>
                            <input name="RoleIds" value="${f.id }" type="checkbox" class="no-margin" />
                          </td>
                          <td>
                            <span class="name">
                              	${f.name }
                            </span>
                          </td>
                          <td>
                            <span class="name">
                              	${f.remark }
                            </span>
                          </td>
                          <td class="hidden-phone">
                            
                            <div class="btn-group">
                              <button data-toggle="dropdown" class="btn btn-mini dropdown-toggle">
                                Action 
                                <span class="caret">
                                </span>
                              </button>
                              <ul class="dropdown-menu">
                                <li>
                                  <a href="RoleActiontoModifyRole?id=${f.id }" class="btn btn-primary"><i class="icon-pencil"></i>修改</a>
                                </li>
                                <li>
                                  <a href="RoleActiondeleteRole?id=${f.id }" class="btn btn-danger"><i class="icon-trash"></i>删除</a>
                                </li>
                              </ul>
                            </div>
                          </td>
                        </tr>
                        </s:iterator>
                        <!--迭代完-->
                   
						<tr>
                          <td colspan="6">
                          <div style="margin-left: 400px;">
							<s:if test="pn == 1 ">
								上一页
							</s:if>
							<s:else>
								<a href="javascript: toPage(${pn-1});">上一页</a>
							</s:else>
							&nbsp;&nbsp;&nbsp;&nbsp;
							<s:if test="pager.ps == pn ">
								下一页
							</s:if>
							<s:else>
								<a href="javascript: toPage(${pn+1});">下一页</a>
							</s:else>
							&nbsp;&nbsp;&nbsp;&nbsp;
							第${pn }页
							</div>
                          </td>
                        </tr>
						<!--over  -->
								</tbody>
							</table>
							<select name="employeeId" id="stateAndCity" class="span6">
					  <option value=""  >
							  -----
							</option>
						<s:iterator value="myEmployees" var="f">
							<option value="${f.id }"  >
							  ${f.empname }
							</option>
						</s:iterator>
					  </select>
					  <button class="btn btn-block btn-info" style="width: 200px" type="submit">
                为员工添加添加角色
              </button>
							<div class="clearfix"></div>
						</div>
					</div>
				</div><!-- end span12 -->
			</div><!-- end row-fluid -->
		</div><!-- end container-fluid -->
    
    	
    </div>
    <jsp:include page="../common/footer.jsp"></jsp:include>
    
    <!-- ================== PAGE LEVEL PLUGINS START ================== -->
	<script src="resource/assets/data-table/js/jquery-data-table.js"></script>
	<script src="resource/assets/data-table/js/data-table.js"></script>
	<!-- ================== PAGE LEVEL PLUGINS END ================== -->
    
    <jsp:include page="../common/foot.jsp"></jsp:include>
    <script>
function toPage(pn){
	document.getElementById("pn").value = pn;
	document.forms[0].submit();
}
</script>
</html>
